package com.mayikt.event.listener;

import com.mayikt.event.OrderMessageEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class SmsListener implements ApplicationListener<OrderMessageEvent> {

    @Override
    @Async
    public void onApplicationEvent(OrderMessageEvent orderMessageEvent) {
        System.out.println(Thread.currentThread().getName() + "开始发送短信消息内容：" + orderMessageEvent.getJsonObject().toJSONString());
    }
}
